package com.gf.forcesystem.model.dto;

import com.gf.framework.common.json.GfJsonMapper;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author gaofei
 * @date 2022/6/20 22:13
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class BaseMessage {
    @ApiModelProperty("消息类型")
    private String messageType;
    @ApiModelProperty("消息体")
    private String messageInfo;

    public String toJson() {
        return GfJsonMapper.obj2String(this);
    }

    public String toJson(IMessage iMessage) {
        messageType = iMessage.getMessageType();
        messageInfo = iMessage.getMessageType();
        return GfJsonMapper.obj2String(this);
    }
}
